import React  from 'react';
import {Button, Tooltip} from 'antd';
import Icon from "@/plugins/Icon";

interface PropsRules {
    title ?: string,
    className ?: string,
    onClick ?: Function,
}
const BtnReload = (props: PropsRules) => {
    function btnClick() {
        if(props.onClick){
            props.onClick();
        }
    }
    return (
        // <Icon name='ReloadOutlined' type='antd'/>
        <Tooltip getPopupContainer={() => document.body} title={props.title || '刷新页面'} className={props.className}>
            <Button type='text' icon={<Icon name='ReloadOutlined' type='antd'/>} onClick={btnClick}/>
        </Tooltip>
    );
};

export default BtnReload;
